package order.dao;

import java.sql.SQLException;
import order.model.OrderVo;
import java.util.List;
import java.util.Map;
import com.util.SqlMapLocator;

public class OrderDAO {
	private static OrderDAO singleton = new OrderDAO();
	
	public static OrderDAO getInstance(){
		return singleton;
	}
		
	private OrderDAO(){}
	
	public List<OrderVo> orderSelect(Map map) throws Exception{ 
		return (List<OrderVo>)SqlMapLocator.getMapper().queryForList("OrderSelect",map);
	}
	public List<OrderVo> orderSelectOne(int orderNo) throws Exception{ 
		return (List<OrderVo>)SqlMapLocator.getMapper().queryForList("OrderSelectOne",orderNo);
	}
	public int orderCnt() throws Exception{
		return (Integer)SqlMapLocator.getMapper().queryForObject("OrderCnt");
	}
	public void orderStatesUpdate(Map map) throws Exception{
		SqlMapLocator.getMapper().update("OrderStatesUpdate",map);
	}
	public void orderDelete(int orderNo) throws Exception{
		SqlMapLocator.getMapper().delete("OrderDelete",orderNo);
	}
	public void orderInsert(Object obj) throws Exception{
		SqlMapLocator.getMapper().insert("OrderInsert",obj);
	}
	public void orderDetailInsert(List obj) throws Exception{
		SqlMapLocator.getMapper().insert("OrderDetailInsert",obj);
	}
}
